import request from '@/utils/request'

// DashBoard页

// 服务状态展现
export function getServiceStateNums() {
  return request({
    url: '/monitor_api/cmState/queryClusterState',
    method: 'get'
  })
}

// 事件展现
// 查询告警总次数
export function getTotalWarning() {
  return request({
    url: 'api/reportManageController/getTotalWarning',
    method: 'get'
  })
}
// 查询各个平台各个级别的告警总次数
export function getAllPlatformWarning() {
  return request({
    url: 'api/reportManageController/getAllPlatformWarning',
    method: 'get'
  })
}
// 查询运维平台各个级别的告警 明细数据
export function getYunweiDetailData(data) {
  return request({
    url: 'api/reportManageController/getYunweiDetailData',
    method: 'post',
    data
  })
}
// 查询调度平台各个级别的告警 明细数据
export function getDiaoduDetailData(data) {
  return request({
    url: 'api/reportManageController/getDiaoduDetailData',
    method: 'post',
    data
  })
}
// 查询流平台各个级别的告警 明细数据
export function getLiuDetailData(data) {
  return request({
    url: 'api/reportManageController/getLiuDetailData',
    method: 'post',
    data
  })
}
// 查询UDSP各个级别的告警 明细数据
export function getUdspDetailData(data) {
  return request({
    url: 'api/reportManageController/getUdspDetailData',
    method: 'post',
    data
  })
}
// 查询各个平台 本年度 每天告警次数的折线图统计
export function getAllPlatformWarningCharts() {
  return request({
    url: 'api/reportManageController/getAllPlatformWarningCharts',
    method: 'get'
  })
}

// 查询流平台总任务数
export function getStreamTotalTasks() {
  return request({
    url: 'api/reportManageController/getStreamTotalTasks',
    method: 'get'
  })
}
// 查询不同类流任务数（完成、待执行、正在、停止、失败）
export function getStreamDifferentTasks() {
  return request({
    url: 'api/reportManageController/getStreamDifferentTasks',
    method: 'get'
  })
}
// 查询不同类流任务数  明细数据
export function getLiuDiffDetailData(data) {
  return request({
    url: 'api/reportManageController/getLiuDiffDetailData',
    method: 'post',
    data
  })
}

// 查询调度平台总任务数
export function getDispatchTotalTasks() {
  return request({
    url: 'api/reportManageController/getDispatchTotalTasks',
    method: 'get'
  })
}

// 查询udsp总接口数
export function getUdspInterfaceNums() {
  return request({
    url: 'api/reportManageController/getUdspInterfaceNums',
    method: 'get'
  })
}
// 查询每个接口的执行次数
export function getUdspEachInterfaceNums() {
  return request({
    url: 'api/reportManageController/getUdspEachInterfaceNums',
    method: 'get'
  })
}

// 查询主机操作总次数
export function getMachineOperatorTotalNums() {
  return request({
    url: 'api/reportManageController/getMachineOperatorTotalNums',
    method: 'get'
  })
}
// 查询主机操作次数详情
export function getMachineOperatorNumDetails() {
  return request({
    url: 'api/reportManageController/getMachineOperatorNumDetails',
    method: 'get'
  })
}

// 查询运维平台申请总次数
export function getApplyTotal() {
  return request({
    url: 'api/reportManageController',
    method: 'get'
  })
}

// 查询申请总次数
export function getApply1() {
  return request({
    url: 'api/reportManageController/getApply1',
    method: 'get'
  })
}
// 查询申请总次数明细
export function getApplyDetail1(data) {
  return request({
    url: 'api/reportManageController/getApplyDetail1',
    method: 'post',
    data
  })
}

// 查询AD(大数据集群用户)申请次数
export function getApply2() {
  return request({
    url: 'api/reportManageController/getApply2',
    method: 'get'
  })
}
// 查询AD(大数据集群用户)申请次数明细
export function getApplyDetail2(data) {
  return request({
    url: 'api/reportManageController/getApplyDetail2',
    method: 'post',
    data
  })
}

// 查询ClientDeploy(客户端部署)申请次数
export function getApply3() {
  return request({
    url: 'api/reportManageController/getApply3',
    method: 'get'
  })
}
// 查询ClientDeploy(客户端部署)申请次数明细
export function getApplyDetail3(data) {
  return request({
    url: 'api/reportManageController/getApplyDetail3',
    method: 'post',
    data
  })
}

// 查询NDeploy(非多租户部署)申请次数
export function getApply4() {
  return request({
    url: 'api/reportManageController/getApply4',
    method: 'get'
  })
}
// 查询NDeploy(非多租户部署)申请次数明细
export function getApplyDetail4(data) {
  return request({
    url: 'api/reportManageController/getApplyDetail4',
    method: 'post',
    data
  })
}

// 查询Hive(hive库)申请次数
export function getApply5() {
  return request({
    url: 'api/reportManageController/getApply5',
    method: 'get'
  })
}
// 查询Hive(hive库)申请次数明细
export function getApplyDetail5(data) {
  return request({
    url: 'api/reportManageController/getApplyDetail5',
    method: 'post',
    data
  })
}

// 查询Yarn(yarn队列)申请次数
export function getApply6() {
  return request({
    url: 'api/reportManageController/getApply6',
    method: 'get'
  })
}
// 查询Yarn(yarn队列)申请次数明细
export function getApplyDetail6(data) {
  return request({
    url: 'api/reportManageController/getApplyDetail6',
    method: 'post',
    data
  })
}

// 查询Impala(impala队列)申请次数
export function getApply7() {
  return request({
    url: 'api/reportManageController/getApply7',
    method: 'get'
  })
}
// 查询Impala(impala队列)申请次数明细
export function getApplyDetail7(data) {
  return request({
    url: 'api/reportManageController/getApplyDetail7',
    method: 'post',
    data
  })
}

// 查询Hdfs(hdfs目录)申请次数
export function getApply8() {
  return request({
    url: 'api/reportManageController/getApply8',
    method: 'get'
  })
}
// 查询Hdfs(hdfs目录)申请次数明细
export function getApplyDetail8(data) {
  return request({
    url: 'api/reportManageController/getApplyDetail8',
    method: 'post',
    data
  })
}

// 查询Application(应用)申请次数
export function getApply9() {
  return request({
    url: 'api/reportManageController/getApply9',
    method: 'get'
  })
}
// 查询Application(应用)申请次数明细
export function getApplyDetail9(data) {
  return request({
    url: 'api/reportManageController/getApplyDetail9',
    method: 'post',
    data
  })
}

// 服务运行状态展现
// yarn当日作业总数
export function getYarnCurdateTaskNums() {
  return request({
    url: 'api/reportManageController/getYarnCurdateTaskNums',
    method: 'get'
  })
}
// impala当日作业总数
export function getImpalaCurdateTaskNums() {
  return request({
    url: 'api/reportManageController/getImpalaCurdateTaskNums',
    method: 'get'
  })
}
// 最近30天在线场次任务数据统计
export function selectOnLineTaskStatus() {
  return request({
    url: 'api/reportManageController/selectOnLineTaskStatus',
    method: 'get'
  })
}
// 最近30天离线场次任务数据统计
export function selectTaskStatusTotal() {
  return request({
    url: 'api/reportManageController/selectTaskStatusTotal',
    method: 'get'
  })
}
// 最近七天实时写入tps值统计
export function getTps() {
  return request({
    url: 'api/reportManageController/getTps',
    method: 'get'
  })
}
// 最近七天实时查询qps值统计
export function getQps() {
  return request({
    url: 'api/reportManageController/getQps',
    method: 'get'
  })
}

// 资源监控总体展现
// 不同集群在最近24小时内的yarn内存使用率
export function getResourceUsageYarn() {
  return request({
    url: 'api/reportManageController/getResourceUsageYarn',
    method: 'get'
  })
}
// 不同集群在最近24小时内的Impala内存使用量
export function getResourceUsageImpala() {
  return request({
    url: 'api/reportManageController/getResourceUsageImpala',
    method: 'get'
  })
}
// 最新时刻Hdfs内存使用率(%)
export function getHdfsUse() {
  return request({
    url: 'api/reportManageController/getHdfsUse',
    method: 'get'
  })
}

// =====================================================================

// 资源分配报表
// 按集群分配内存
export function getClusterMemory() {
  return request({
    url: 'api/reportManageController/getClusterMemory',
    method: 'get'
  })
}
// 按用户分配内存
export function getUserMemory() {
  return request({
    url: 'api/reportManageController/getUserMemory',
    method: 'get'
  })
}
// 按机构分配内存
export function getDeptMemory() {
  return request({
    url: 'api/reportManageController/getDeptMemory',
    method: 'get'
  })
}

// =====================================================================

// 资源利用率报表
// 查询报表集群配置信息
export function selAllOptions() {
  return request({
    url: '/api/reportManageController/selAllOptions',
    method: 'get'
  })
}

// 查询所有队列信息
export function selAllQueue(data) {
  return request({
    url: '/api/reportManageController/selAllQueue',
    method: 'post',
    data: data
  })
}

// 查询报表信息
export function selReportInfo(data) {
  return request({
    url: '/api/reportManageController/selReportInfo',
    method: 'post',
    data: data
  })
}

// 流今日错误
export function getLiu() {
  return request({
    url: 'api/reportManageController/getStreamFailTasks',
    method: 'get'
  })
}

// 应用信息
export function getApplication() {
  return request({
    url: 'api/reportManageController/selectApplicationInfo',
    method: 'get'
  })
}

// 组资源
export function getGroup() {
  return request({
    url: 'api/reportManageController/getGroupResourceStatistic',
    method: 'get'
  })
}

// 应用资源使用
export function getAppUse() {
  return request({
    url: 'api/reportManageController/queryApplicationResource',
    method: 'get'
  })
}

// 事件告警

export function getAlarm() {
  return request({
    url: '/api/reportManageController/getAlarm',
    method: 'get'
  })
}

// 公共应用告警
export function getAlarmHistory() {
  return request({
    url: '/api/reportManageController/selectAppAlarmRecord',
    method: 'get'
  })
}
// 模块表格
export function getAlarmTable() {
  return request({
    url: '/api/reportManageController/selectApplicationDetails',
    method: 'get'
  })
}
// 模块链接图
export function getModelEcharts() {
  return request({
    url: '/api/reportManageController/selectModuleConnect',
    method: 'get'
  })
}

// 应用名称
export function getAppName() {
  return request({
    url: 'api/reportManageController/queryAllApplicationName',
    method: 'get'
  })
}
// yarn资源
export function getYarnRes(data) {
  return request({
    url: 'api/reportManageController/queryApplicationYarn?applicationName=' + data,
    method: 'get'
  })
}
// impala资源
export function getImpalaRes(data) {
  return request({
    url: 'api/reportManageController/queryApplicationImpala?applicationName=' + data,
    method: 'get'
  })
}
// hdfs資源
export function getHdfsRes(data) {
  return request({
    url: 'api/reportManageController/queryApplicationHdfs?applicationName=' + data,
    method: 'get'
  })
}
// 首页接口查询
export function getUdspTotal() {
  return request({
    url: '/api/reportManageController/getInterfaceInfo',
    method: 'get'
  })
}
// udsp饼图
export function getUdspCake(data) {
  return request({
    url: '/api/reportManageController/getUdspEachData',
    method: 'post',
    data: data
  })
}
// udsp折线图
export function getUdspInfo() {
  return request({
    url: '/api/reportManageController/selectUdspIntefaceInfo',
    method: 'get'
  })
}
// udsp点击表格的折线图
export function getUdspEch(data) {
  return request({
    url: '/api/reportManageController/selectSingleInteData',
    method: 'post',
    data: data
  })
}
//yarn资源分配
export function getYarnFp() {
  return request({
    url: '/api/reportManageController/getResourcefpYarn',
    method: 'get'
  })
}
//udsp总数
export function getUdspInter() {
  return request({
    url: '/api/reportManageController/selectUdspInterTotal',
    method: 'get'
  })
}
//当日事件告警
export function getTodayAlarm() {
  return request({
    url: '/api/reportManageController/selectTodayAlarm',
    method: 'get'
  })
}
export default {
  getServiceStateNums,

  getTotalWarning, getAllPlatformWarning, getYunweiDetailData, getDiaoduDetailData, getUdspDetailData, getLiuDetailData, getAllPlatformWarningCharts,
  getStreamTotalTasks, getStreamDifferentTasks, getLiuDiffDetailData,
  getDispatchTotalTasks,
  getUdspInterfaceNums, getUdspEachInterfaceNums,
  getMachineOperatorTotalNums, getMachineOperatorNumDetails,
  getApplyTotal, getApply1, getApplyDetail1, getApply2, getApplyDetail2, getApply3, getApplyDetail3, getApply4, getApplyDetail4, getApply5, getApplyDetail5, getApply6, getApplyDetail6, getApply7, getApplyDetail7, getApply8, getApplyDetail8, getApply9, getApplyDetail9,

  getYarnCurdateTaskNums, getImpalaCurdateTaskNums, getTps, getQps, selectTaskStatusTotal,

  getResourceUsageYarn, getResourceUsageImpala, getHdfsUse,

  getClusterMemory, getUserMemory, getDeptMemory,

  selAllOptions, selReportInfo, getLiu, getApplication, getGroup, getAppUse, getAlarm, getAlarmHistory, getAlarmTable,
  getModelEcharts, getAppName, getYarnRes, getImpalaRes, getUdspTotal, getUdspCake, getUdspInfo, getUdspEch, getHdfsRes, selAllQueue,
  selectOnLineTaskStatus ,getYarnFp,getUdspInter,getTodayAlarm


}
